#{extends 'mana-main.html' /}
#{set typeActive :"active" /}
#{set title :"类型管理" /}
#{set 'moreStyles' }
<style type="text/css" media="screen">
        .typeList{
            margin-top: 60px;
        }
    </style>
#{/set}
<div class="typeList">
	<ul class="nav nav-tabs">
		#{list items:typenameList,as :'name'}
		<li ${type==name[0]?'class=active':''}>
			<a href="/types/showtype?type=${name[0]}">${name[1]}</a>
		</li>
		#{/list}
	</ul>
	<form action="@{Types.addType}" method="post" class="span10 offset1">
		<input type="hidden" name="typename.attrubite" value="${type}">
		<div class="input-append">
			<input type="text" name="typename.typeName" placeholder="类型显示的名字">
			<input class="btn btn-success" type="submit" value="添加新类型">
		</div>
	</form>


	<form action="@{Types.editTypeWeight}" method="post" class="span10 offset1">
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th class="span2">序号</th>
					<th class="span3">分类名称</th>
					<th class="span3">权重</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
			#{list items:typeList,as :'type'}
				<tr>
					<td>${typeList.indexOf(type)+1}</td>
					<td>${type.typeName}</td>
					<td>
						<input type="hidden" name="typeId[]" value="${type.id}">
						<input type="text" name="weight[]" value="${type.weight}">
					</td>
					<td>
						<a href="@{Types.deleteType(type.id)}" title="" class="btn btn-danger">删除</a>
					</td>
				</tr>
			#{/list}
			</tbody>
		</table>
		<input class="btn btn-success" type="submit" value="修改权重">
	</form>


</div>